﻿<%@ Page Language="C#" AutoEventWireup="true" Culture="en-GB" CodeFile="SaleRegisterPrint.aspx.cs"
    Inherits="Main_Reports_Accounts_SaleRegisterPrint" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Sale Transaction(s)</title>
    <link href="../../../Styles/accounts.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        /* @media print
	{
		th 
		{
			color:black;
			background-color:white;
			border:solid 1 black;
		}
		tHead
        {
           display : table-header-group;
           border : solid 1 black;
        }
        
        
		
	} */
	
	#grdDisplay tr
        {
            page-break-inside: avoid;
            page-break-after: auto;
        }
        #grdDisplay thead
        {
            display: table-header-group;
        }
        #grdDisplay tfoot
        {
            display: table-footer-group;
        }
    </style>

    <script language="javascript" type="text/javascript">
        //        function AddTHEAD(tableName) {
        //            var table = document.getElementById(tableName);
        //            if (table != null) {
        //                var head = document.createElement("THEAD");
        //                head.style.display = "table-header-group";
        //                head.appendChild(table.rows[0]);
        //                table.insertBefore(head, table.childNodes[0]);
        //            }
        //        }
        function prntgrid() {
            var dd = document.getElementById("lnkprint").style.visibility = "hidden";
            window.print();
            this.close();
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div style="margin-top: 20px;">
        <asp:HyperLink ID="lnkprint" runat="server" Text="Print" NavigateUrl="#" onclick="prntgrid();"></asp:HyperLink>
        <center>
            <b>
                <asp:Label ID="lblCompname" runat="server"></asp:Label></b></center>
        <center>
            <b>
                <asp:Label ID="lblMsg" runat="server"></asp:Label></b></center>
        <asp:GridView ID="grdDisplay" Width="100%" runat="server" AutoGenerateColumns="false"
            CssClass="gridview" PageSize="10" ShowFooter="true" RowStyle-CssClass="gridviewitem"
            OnRowDataBound="grdDisplay_RowDataBound" FooterStyle-CssClass="gridviewitem">
            <Columns>
                <asp:TemplateField HeaderText="S.No." ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <%--<%# Container.DataItemIndex+1 %>--%>
                        <asp:Label ID="lblsno" runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="Date" DataField="TransactionDate" DataFormatString="{0:dd-MMM-yyyy}" />
                <asp:BoundField HeaderText="Transaction Type" DataField="Name" />
                <asp:BoundField HeaderText="Voucher No" DataField="transactionnumber" />
                <asp:BoundField HeaderText="Particulars" DataField="Particulars" />
                <asp:TemplateField HeaderText="Debit">
                    <ItemStyle HorizontalAlign="Right" />
                    <ItemTemplate>
                        <asp:Label ID="lblDebit" runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Credit">
                    <ItemStyle HorizontalAlign="Right" />
                    <ItemTemplate>
                        <asp:Label ID="lblCredit" runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataRowStyle ForeColor="Red" Font-Bold="true" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                NO RECORD TO PRINT !
            </EmptyDataTemplate>
        </asp:GridView>
    </div>
    </form>
</body>
</html>
